import axios from '@/libs/api.request'

export const getExtMethodNames = () => {
    return axios.request({
        url: 'api/HttpAutoTestService/ext_method/names/',
        method: 'get'
    })
};

export const getExtMethods = (val) => {
    return axios.request({
        url: 'api/HttpAutoTestService/ext_methods/',
        params: val,
        method: 'get'
    })
};

export const createExtMethod = (extMethod) => {
    return axios.request({
        url: 'api/HttpAutoTestService/ext_method/',
        data: extMethod,
        method: 'post'
    })
};

export const updateExtMethod = (extMethod) => {
    return axios.request({
        url: `api/HttpAutoTestService/ext_method/${extMethod.id}/`,
        data: extMethod,
        method: 'put'
    })
};

export const deleteExtMethod = (id) => {
    return axios.request({
        url: `api/HttpAutoTestService/ext_method/${id}/`,
        method: 'delete'
    })
};